let message="Hello ABC,abc,Abc,AAabc"
const pattern=/abc/ig
const result1=message.match(pattern)
console.log(result1)  //[ 'ABC', 'abc', 'Abc', 'abc' ]

message=message.replaceAll(pattern,'Abc')
console.log(message) //Hello Abc,Abc,Abc,AAAbc